<?

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
mysql_connect("localhost","infopark_com_ua","8888zG6Wtv1k");
mysql_select_db("dev_infopark_com_ua");

$result=mysql_query("SELECT DISTINCT n.nid FROM `taxonomy_index` t 
LEFT JOIN node n ON n.nid=t.nid
WHERE t.tid=111 AND n.type='event'
ORDER BY n.nid");
while($r=mysql_fetch_assoc($result))
  {
    
   /* $sql1="INSERT INTO field_revision_field_recommended (entity_type,bundle,deleted,entity_id,revision_id,language,delta,field_recommended_value) 
        VALUES ('node','event',0,".$r['nid'].",".$r['nid'].",'und',0,1)";
    print $sql1."\n";
    mysql_query($sql1);*/
     $sql2="INSERT INTO field_data_field_recommended (entity_type,bundle,deleted,entity_id,revision_id,language,delta,field_recommended_value) 
        VALUES ('node','event',0,".$r['nid'].",".$r['nid'].",'und',0,1)";
    print $sql2."\n";
    mysql_query($sql2);
    
    }

?>
